package com.xywh.emergency_outbound.mvp.ui.activity;

import com.xywh.emergency_outbound.R;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
import static android.support.test.espresso.action.ViewActions.typeText;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isEnabled;
import static android.support.test.espresso.matcher.ViewMatchers.withId;

/**
 * @author 小星 QQ:753940262
 * @class describe
 * @time 2019/11/12 0012 14:34
 */
public class AddressAddActivityTest {

    @Before
    public void setUp() throws Exception {
    }

    @After
    public void tearDown() throws Exception {
    }

    @Test
    public void onViewClicked() {

        onView(withId(R.id.xet_receiver)).perform(typeText("收货人111"), closeSoftKeyboard());
        onView(withId(R.id.xet_cellphone_number)).perform(typeText("13568458796"), closeSoftKeyboard());
        onView(withId(R.id.xet_address)).perform(typeText("山东省青岛市市南区江西路64号"), closeSoftKeyboard());
        onView(withId(R.id.cb_default)).perform(click());
        onView(withId(R.id.btn_save)).check(matches(isEnabled()));
    }
}